package com.usesion.service;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Component;

/**
 * 权限 前台页面使用
 * @author XT
 */
@Component
public class PermissionService {

    public String hasPermi(String permission) {
        return isPermittedOperator(permission) ? "" : "hidden";
    }

    private boolean isPermittedOperator(String permission) {
        if (SecurityUtils.getSubject().isPermitted(permission)) {
            return true;
        } else {
            return false;
        }
    }
}
